package tv.drplay.course.hook

import androidx.fragment.app.Fragment
import com.baidu.mobstat.StatService
import top.kpromise.ibase.lifecycle.FragmentLifeCycleCall

class BaiduAnalyticsForFragment (nextLifeCycle: FragmentLifeCycleCall? = null) : FragmentLifeCycleCall(nextLifeCycle) {

    override fun onCreate(fragment: Fragment) {
        super.onCreate(fragment)
        StatService.onPageStart(fragment.context, fragment.javaClass.simpleName)
    }

    override fun onDestroy(fragment: Fragment) {
        super.onDestroy(fragment)
        StatService.onPageEnd(fragment.context, fragment.javaClass.simpleName)
    }
}